//01 导入组件
import NotifyVue from './NotifyCom.vue'
//定义插件
var Notify = {}
//实现install方法
Notify.install = function (Vue) {
    //02 获取组件的构造函数
    var NotifyCom = Vue.extend(NotifyVue);
    //03 创建实例
    var instance = new NotifyCom();
    //04 手动挂载真实dom
    instance.$mount(document.createElement("div"));
    //05 插入到body的标签中
    document.body.appendChild(instance.$el);
    //06 同步插件Notify和NotifyVue实例的方法
    Notify.show = instance.show;
    Notify.hide = instance.hide;
    Notify.success = instance.success;
    Notify.danger = instance.danger;
    Notify.warning = instance.warning;
    //挂载到全局
    Vue.prototype.$notify = Notify;
}
//导出
export default Notify;